#ifndef GAMEMAIN_HPP
#define GAMEMAIN_HPP

/**
  * @file GameMain.hpp
  * @author Ryan Van Why
  * @brief This is the main class for the program.
  * This contains the MinigameManager as a member.
  */

namespace mindsweeper {
namespace main {
class GameMain;
}
}

// This allows us to create a window & rendering context
#include <SFML/Window.hpp>

// Mindsweeper
#include "GameManager.hpp" // Holds and manages the sub-games
#include "TimeHandler.hpp" // For timestep calculation

namespace mindsweeper {
namespace main {

class GameMain {
	public:
		/**
		  * @brief The constructor for this class.
		  */
		GameMain();

		/**
		  * @brief The destructor for this class.
		  * This is necessary to clean up the gameManager object.
		  */
		~GameMain();

		/**
		  * @brief This is the main function for the game.
		  * @return The status code to send to the OS upon exit
		  */
		int exec();

		/**
		  * @brief Allows access to the main TimeHandler instance.
		  * @return A reference to a TimeHandler.
		  */
		TimeHandler& getTimeHandler();
	
	private:
		/**
		  * @brief Process an event
		  * @param event The event to process
		  */
		void processEvent(sf::Event &event);

		// The window/GL context
		sf::Window window;

		// A pointer to the main GameManager instance
		GameManager *gameManager;

		// The main TameHandler instance
		TimeHandler timeHandler;
};

// End namespaces
}
}

#endif // GAMEMAIN_HPP
